package com.code.monitor.constants;

/**
 * @author ggh
 * @date 2023/5/8
 */
public enum OperateType {
    START(1, "启动"),
    STOP(2, "停止");

    private Integer type;

    private String msg;

    OperateType(Integer type, String msg) {
        this.type = type;
        this.msg = msg;
    }

    public String getMsg() {
        return msg;
    }

    public Integer getType() {
        return type;
    }

    public static OperateType parse(Integer type) {
        for (OperateType operateType : values()) {
            if (operateType.getType().equals(type)) {
                return operateType;
            }
        }
        return null;
    }
}
